<div class="modal-content">
<div class="modal-header">
  <h6 class="modal-title text-purple">选择附件</h6>
  <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span></button>
</div>
<div class="modal-body py-3">
  <form class="mb-2" action="{:DcUrl('attachment/editor/index')}" method="get" data-toggle="attachment-form">
    <div class="input-group">
      <input type="text" class="form-control form-control-sm" name="searchText" id="searchText" value="{$searchText}" maxlength="30" autocomplete="off" data-toggle="attachment-search">
      <div class="input-group-append">
        <button class="btn btn-sm btn-secondary" type="button" data-referer="{:input('get.pageStart/d',0)}" data-start="{$pageStart|default=0}" data-toggle="attachment-start">下一页</button>
        <button class="btn btn-sm btn-dark" type="submit" data-toggle="submit"><i class="fa fa-search mr-1"></i>搜索</button>
      </div>
    </div>
  </form>
  <div class="row row-1">
    {volist name="data" id="attachment"}
    <div class="col-4 px-1 my-1">
      <div class="card shadow">
        {if $attachment['image']}
        <img class="card-img-top" src="{:DcUrlImage($attachment['info_excerpt'])}" height="100">
        {else/}
        <img class="card-img-top" src="{$path_root}public/images/x.gif" height="100">
        {/if}
        <div class="card-body p-2">
          <p class="card-title text-truncate">{$attachment.info_title}</p>
          <p class="d-flex flex-row justify-content-between align-items-center mb-0" 
             data-id="{$attachment.info_id}"
             data-title="{$attachment.info_title}"
             data-score="{$attachment.attachment_score}"
             data-image="{$attachment.image}">
            <a class="text-dark" href="{:DcUrl('attachment/index/id',['val'=>$attachment['info_id']])}" data-toggle="attachment-insert">插入</a>
            <a class="text-dark" href="{:DcUrl('attachment/editor/edit',['id'=>$attachment['info_id']])}" data-toggle="attachment-edit">修改</a>
            <a class="text-dark" href="{:DcUrl('attachment/apis/delete',['id'=>$attachment['info_id']])}" data-toggle="attachment-delete">删除</a>
          </p>
         </div>
      </div>
    </div>
    {/volist}
    {empty name="data"}
      <div class="col-12 text-center p-3 h4 shadow">没有数据!!!</p>
    {/empty}
  </div>
</div>
</div>